3.360 \(\int x \csc (x) \sin (3 x) \, dx\)

Optimal. Leaf size=31 \[ \frac {x^2}{2}-\frac {\sin ^2(x)}{4}+\frac {3 \cos ^2(x)}{4}+2 x \sin (x) \cos (x) \]

[Out]

1/2*x^2+3/4*cos(x)^2+2*x*cos(x)*sin(x)-1/4*sin(x)^2

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 3, integrand size = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {4431, 3310, 30} \[ \frac {x^2}{2}-\frac {\sin ^2(x)}{4}+\frac {3 \cos ^2(x)}{4}+2 x \sin (x) \cos (x) \]

Antiderivative was successfully verified.

[In]

Int[x*Csc[x]*Sin[3*x],x]

[Out]

x^2/2 + (3*Cos[x]^2)/4 + 2*x*Cos[x]*Sin[x] - Sin[x]^2/4

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 3310

Int[((c_.) + (d_.)*(x_))*((b_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(d*(b*Sin[e + f*x])^n)/(f^2*n
^2), x] + (Dist[(b^2*(n - 1))/n, Int[(c + d*x)*(b*Sin[e + f*x])^(n - 2), x], x] - Simp[(b*(c + d*x)*Cos[e + f*
x]*(b*Sin[e + f*x])^(n - 1))/(f*n), x]) /; FreeQ[{b, c, d, e, f}, x] && GtQ[n, 1]

Rule 4431

Int[((e_.) + (f_.)*(x_))^(m_.)*(F_)[(a_.) + (b_.)*(x_)]^(p_.)*(G_)[(c_.) + (d_.)*(x_)]^(q_.), x_Symbol] :> Int
[ExpandTrigExpand[(e + f*x)^m*G[c + d*x]^q, F, c + d*x, p, b/d, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && M
emberQ[{Sin, Cos}, F] && MemberQ[{Sec, Csc}, G] && IGtQ[p, 0] && IGtQ[q, 0] && EqQ[b*c - a*d, 0] && IGtQ[b/d,
1]

Rubi steps

\begin {align*} \int x \csc (x) \sin (3 x) \, dx &=\int \left (3 x \cos ^2(x)-x \sin ^2(x)\right ) \, dx\\ &=3 \int x \cos ^2(x) \, dx-\int x \sin ^2(x) \, dx\\ &=\frac {3 \cos ^2(x)}{4}+2 x \cos (x) \sin (x)-\frac {\sin ^2(x)}{4}-\frac {\int x \, dx}{2}+\frac {3 \int x \, dx}{2}\\ &=\frac {x^2}{2}+\frac {3 \cos ^2(x)}{4}+2 x \cos (x) \sin (x)-\frac {\sin ^2(x)}{4}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 22, normalized size = 0.71 \[ \frac {x^2}{2}+x \sin (2 x)+\frac {1}{2} \cos (2 x) \]

Antiderivative was successfully verified.

[In]

Integrate[x*Csc[x]*Sin[3*x],x]

[Out]

x^2/2 + Cos[2*x]/2 + x*Sin[2*x]

________________________________________________________________________________________

fricas [A]  time = 0.45, size = 17, normalized size = 0.55 \[ 2 \, x \cos \relax (x) \sin \relax (x) + \frac {1}{2} \, x^{2} + \cos \relax (x)^{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*csc(x)*sin(3*x),x, algorithm="fricas")

[Out]

2*x*cos(x)*sin(x) + 1/2*x^2 + cos(x)^2

________________________________________________________________________________________

giac [A]  time = 0.15, size = 18, normalized size = 0.58 \[ \frac {1}{2} \, x^{2} + x \sin \left (2 \, x\right ) + \frac {1}{2} \, \cos \left (2 \, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*csc(x)*sin(3*x),x, algorithm="giac")

[Out]

1/2*x^2 + x*sin(2*x) + 1/2*cos(2*x)

________________________________________________________________________________________

maple [A]  time = 0.06, size = 26, normalized size = 0.84 \[ 4 x \left (\frac {\cos \relax (x ) \sin \relax (x )}{2}+\frac {x}{2}\right )-\frac {3 x^{2}}{2}-\left (\sin ^{2}\relax (x )\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*csc(x)*sin(3*x),x)

[Out]

4*x*(1/2*cos(x)*sin(x)+1/2*x)-3/2*x^2-sin(x)^2

________________________________________________________________________________________

maxima [A]  time = 0.32, size = 18, normalized size = 0.58 \[ \frac {1}{2} \, x^{2} + x \sin \left (2 \, x\right ) + \frac {1}{2} \, \cos \left (2 \, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*csc(x)*sin(3*x),x, algorithm="maxima")

[Out]

1/2*x^2 + x*sin(2*x) + 1/2*cos(2*x)

________________________________________________________________________________________

mupad [B]  time = 0.09, size = 18, normalized size = 0.58 \[ \frac {\cos \left (2\,x\right )}{2}+x\,\sin \left (2\,x\right )+\frac {x^2}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x*sin(3*x))/sin(x),x)

[Out]

cos(2*x)/2 + x*sin(2*x) + x^2/2

________________________________________________________________________________________

sympy [A]  time = 1.88, size = 37, normalized size = 1.19 \[ - x^{2} \sin ^{2}{\relax (x )} - x^{2} \cos ^{2}{\relax (x )} + \frac {3 x^{2}}{2} + 2 x \sin {\relax (x )} \cos {\relax (x )} + \cos ^{2}{\relax (x )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*csc(x)*sin(3*x),x)

[Out]

-x**2*sin(x)**2 - x**2*cos(x)**2 + 3*x**2/2 + 2*x*sin(x)*cos(x) + cos(x)**2

________________________________________________________________________________________